home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Navigation Services SDK / Examples / SimpleText / SimpleText ƒ / AGFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-16  |  4.4 KB  |  149 lines  |  [TEXT/MPS ]

  1. /***************************************************************************************
  2.  
  3.     File:        AGFile.h
  4.  
  5.     Contains:    Public interface to Apple Guide Database Files.
  6.                 Does not use or require the Apple Guide extension.
  7.  
  8.     Version:    GX 1.2 or later
  9.  
  10. ** Copyright 1993-1996 Apple Computer. All rights reserved.
  11. **
  12. **    You may incorporate this sample code into your applications without
  13. **    restriction, though the sample code has been provided "AS IS" and the
  14. **    responsibility for its operation is 100% yours.  However, what you are
  15. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  16. **    after having made changes. If you're going to re-distribute the source,
  17. **    we require that you make it clear in the source that the code was
  18. **    descended from Apple Sample Code, but that you've made changes.
  19.  
  20. ***************************************************************************************/
  21.  
  22. #ifndef __AGFILE__
  23. #define __AGFILE__
  24.  
  25. #ifndef __FILES__
  26.     #include <Files.h>
  27. #endif
  28.  
  29. #ifndef __TYPES__
  30.     #include <Types.h>
  31. #endif
  32.  
  33.             // typedef's
  34.  
  35. typedef FSSpec AGFileFSSpecType;
  36. typedef short AGFileSelectorCountType;
  37. typedef short AGFileSelectorIndexType;
  38. typedef OSType AGFileSelectorType;
  39. typedef long AGFileSelectorValueType;
  40. typedef short AGFileDBType;
  41. typedef ConstStr63Param AGFileDBMenuNamePtr;
  42. typedef short AGFileDBScriptType;
  43. typedef short AGFileDBRegionType;
  44. typedef short AGFileMajorRevType;
  45. typedef short AGFileMinorRevType;
  46. typedef short AGFileCountType;
  47.  
  48.             // Database types (for AGFileDBType parameter).
  49.  
  50. enum
  51. {
  52.     kAGFileDBTypeAny =            0,
  53.     kAGFileDBTypeHelp =            1,
  54.     kAGFileDBTypeTutorial =        2,
  55.     kAGFileDBTypeShortcuts =    3,
  56.     kAGFileDBTypeAbout =        4,
  57.     kAGFileDBTypeOther =        8
  58. };
  59.  
  60.             // Functions.
  61.  
  62.         // Get the database menu item name.
  63. pascal OSErr
  64. AGFileGetDBMenuName(AGFileFSSpecType *fileSpec,
  65.                     AGFileDBMenuNamePtr menuItemNameString);
  66.  
  67.         // Get the database type.
  68. pascal OSErr
  69. AGFileGetDBType(AGFileFSSpecType *fileSpec,
  70.                 AGFileDBType *databaseType);
  71.  
  72.         // Get the version of the software
  73.         // that created this database.
  74. pascal OSErr
  75. AGFileGetDBVersion(AGFileFSSpecType *fileSpec,
  76.                     AGFileMajorRevType *majorRev,
  77.                     AGFileMinorRevType *minorRev);
  78.  
  79.         // Get the database script and region information.
  80. pascal OSErr
  81. AGFileGetDBCountry(AGFileFSSpecType *fileSpec,
  82.                     AGFileDBScriptType *script,
  83.                     AGFileDBRegionType *region);
  84.  
  85.         // Return the number of selectors in database.
  86. pascal AGFileSelectorCountType
  87. AGFileGetSelectorCount(AGFileFSSpecType *fileSpec);
  88.  
  89.         // Get the i-th database selector (1 to AGFileSelectorCountType)
  90.         // and its value.
  91. pascal OSErr
  92. AGFileGetSelector(AGFileFSSpecType *fileSpec,
  93.                     AGFileSelectorIndexType selectorNumber,
  94.                     AGFileSelectorType *selector,
  95.                     AGFileSelectorValueType *value);
  96.  
  97.         // Return true if database is mixin.
  98. pascal Boolean
  99. AGFileIsMixin(AGFileFSSpecType *fileSpec);
  100.  
  101.         // Return the number of database files
  102.         // of the specified databaseType and main/mixin.
  103.         // Any file creator is acceptible,
  104.         // but type must be kAGFileMain or kAGFileMixin.
  105. pascal AGFileCountType
  106. AGFileGetDBCount(short vRefNum,
  107.                     long dirID,
  108.                     AGFileDBType databaseType,
  109.                     Boolean wantMixin);
  110.  
  111.         // Get the FSSpec for the dbIndex-th database
  112.         // of the specified databaseType and main/mixin.
  113.         // Any file creator is acceptible,
  114.         // but type must be kAGFileMain or kAGFileMixin.
  115. pascal OSErr
  116. AGFileGetIndDB(short vRefNum,
  117.                 long dirID,
  118.                 AGFileDBType databaseType,
  119.                 Boolean wantMixin,
  120.                 short dbIndex,
  121.                 FSSpec *fileSpec);
  122.  
  123.         // This selector must match with the application
  124.         // creator in order for this file to appear in the 
  125.         // application's Help menu. Ignored for mixin files
  126.         // because they never appear in the Help menu anyway.
  127.         // If empty (zeros), will appear in the Help menu
  128.         // of any host application.
  129. pascal OSErr
  130. AGFileGetHelpMenuAppCreator(AGFileFSSpecType *fileSpec,
  131.                                 OSType *helpMenuAppCreator);
  132.  
  133.         // This selector must match in the main and mixin
  134.         // files in order for the mixin to mix-in with the main.
  135.         // Empty (zeros) selectors are valid matches.
  136.         // A '****' selector will mix-in with any main.
  137. pascal OSErr
  138. AGFileGetMixinMatchSelector(AGFileFSSpecType *fileSpec,
  139.                                 OSType *mixinMatchSelector);
  140.  
  141.         // This is the text of the balloon for the
  142.         // Help menu item for this database.
  143. pascal OSErr
  144. AGFileGetHelpMenuBalloonText(AGFileFSSpecType *fileSpec,
  145.                                 Str255 helpMenuBalloonString);
  146.  
  147. #endif /* __AGFILE__ */
  148.  
  149.